<template>
	<div>


		<el-menu default-active="2" class="el-menu-vertical-demo" :unique-opened="true" background-color="#222D32" text-color="#B8C7CE"
		 active-text-color="#69f" router>

		<!-- <div v-for="menu in menulist" :index="menu.menuId+''" :key="menu.id" > {{menu.menuName}}</div> -->

			<el-submenu v-for="menu in  menulist" :index="menu.menuId+''" :key="menu.menuId" >
						<template slot="title">
							<i class="el-icon-location"></i>
							<span>{{menu.menuName}}</span>
						</template>
						<el-menu-item-group>
							<el-menu-item :index="childMenu.url" :key="childMenu.menuId" v-for="childMenu in menu.children" >{{childMenu.menuName}} </el-menu-item>
							
						</el-menu-item-group>
		
					</el-submenu>

		</el-menu>
	</div>
</template>

<script>
	export default {
		name: 'Menu',
		components: {

		},
		data() {
			return {
				menulist:[]
				/* menulist:[
					{menuId:1,menuName:'挂号收费',children:[
						{menuId:11,menuName:'挂号',url:'/regist'},
						{menuId:12,menuName:'收费',url:'/fee'},
						{menuId:13,menuName:'退号',url:'/unregist'}
					]},
					{menuId:2,menuName:'门诊医生',children:[
						{menuId:21,menuName:'门诊病历',url:'/doctor'}
						
					]},
					{menuId:3,menuName:'系统管理',children:[
						{menuId:31,menuName:'用户管理',url:'/user'},
						{menuId:32,menuName:'菜单管理',url:'/menu'},
						{menuId:33,menuName:'角色管理',url:'/role'}
					]}
					
				] */
				
				
			}
		},
		methods: {

		},
		created() {
			
			this.axios.get("/menu?type=getUserMenus",(data)=>{
				this.menulist = data;
			})
			
			
		}
	}
</script>

<style>
</style>
